package dp;

public class _02_70_爬楼梯 {
	static int N = 50;
	static int dp[] = new int[N];
	// n阶楼梯的走法=n-1阶的走法+n-2阶的走法
    public static int climbStairs(int n) {
    	dp[1] = 1;
    	dp[2] = 2;
    	for(int i = 3; i <= n; i++) {
    		dp[i] = dp[i-1] + dp[i-2];
    	}
    	return dp[n];
    }
    
    public static void main(String[] args) {
		System.out.println(climbStairs(5));
	}
    
    
}
